package com.zhida.smartcontrol.dialog;

import android.os.Bundle;
import android.text.TextUtils;
import android.widget.TextView;

import com.jay.tools.base.BaseDialogFragment;
import com.zhida.smartcontrol.R;

import butterknife.BindView;

/**
 * author: tanjianpei
 * date: 2019/10/9 009 16:33
 * description: 成功
 */
public class OkDialogFragment extends BaseDialogFragment {
    public static OkDialogFragment newInstance(String des) {
        Bundle args = new Bundle();
        args.putString("des", des);
        OkDialogFragment fragment = new OkDialogFragment();
        fragment.setArguments(args);
        return fragment;
    }

    @BindView(R.id.tv_des)
    TextView mTvDes;

    @Override
    protected Object getLayout() {
        return R.layout.dialog_ok;
    }

    @Override
    protected void initDatas(Bundle savedInstanceState) {
        mCanceledOnTouchOutside = true;
        Bundle bundle = getArguments();
        if (null == bundle) {
            return;
        }
        String des = bundle.getString("des");
        if (TextUtils.isEmpty(des)) {
            des = "保存成功";
        }
        mTvDes.setText(des);

    }


}
